package com.nanhang.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nanhang.common.util.PageResult;
import com.github.pagehelper.PageHelper;
import com.nanhang.entity.student;
import com.nanhang.mapper.studentMapper;
import com.nanhang.service.studentService;
import com.nanhang.vo.StudentVO;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class studentServiceImpl  extends ServiceImpl<studentMapper, student> implements studentService {

    // 1. 分页查询
    @Override
    public PageResult<student> findByPage(Integer page, Integer pageSize) {
//        com.baomidou.mybatisplus.extension.plugins.pagination.Page<student> page1 = this.page(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page, pageSize));
//        return new PageResult<>(page1.getRecords(),page1.getTotal());
        Page<student> page1 = this.page(new Page<>(page,pageSize));
        return new PageResult<>(page1.getRecords(),page1.getPages());
    }

}
